Component({
  properties: {
    selected: {
      type: Number,
      value: 0
    }
  },
  data: {
    "color": "#80bdff",
    "selectedColor": "#459af7",
    "backgroundColor": "#ffffff",
    "borderStyle": "white",
    "list": [{
      "pagePath": "/pages/tabbar/home/index",
      "text": "首页",
      "iconPath": "/images/tabbar_icon/1.png",
      "selectedIconPath": "/images/tabbar_icon/1.png"
    }, {
      "pagePath": "/pages/tabbar/home/index",
      "text": "全部",
      "iconPath": "/images/tabbar_icon/2.png",
      "selectedIconPath": "/images/tabbar_icon/2.png"
    }, {
      "pagePath": "/pages/tabbar/personal/index",
      "text": "我的",
      "iconPath": "/images/tabbar_icon/3.png",
      "selectedIconPath": "/images/tabbar_icon/3.png"
    }],
    selected: 0
  },
  lifetimes: {
    created() {},
    attached() {},
    ready() {},
    moved() {},
    detached() {},
    error(err) {},
  },
  methods: {
    switchTab(e) {
      const {
        index
      } = e.currentTarget.dataset
      this.triggerEvent('switchtab', index)
      this.setData({
        selected: index
      })
    }
  }
})